package com.yndsoft.jc.ui.memberpage.setting;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.yndsoft.jc.R;
import com.yndsoft.jc.activity.BaseActivity;

import butterknife.Bind;

/**
 * Created by hasee on 2017/12/5.
 */

public class MonitorFlowDetailActivity extends BaseActivity implements View.OnClickListener {

    @Bind(R.id.base_backBtn)
    RelativeLayout base_backBtn;
    @Bind(R.id.base_title)
    TextView base_title;
    @Bind(R.id.base_home)
    RelativeLayout base_home;

    @Bind(R.id.webView)
    WebView webView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_monitor_detail);

        setViews();
        setListener();
    }

    private void setViews() {
        Intent intent = getIntent();
//        base_title.setText(getResources().getString(R.string.monitor_flow_detail));
        base_title.setText(intent.getStringExtra(MonitoringGuideActivity.GUID_FLOW_TITLE));
        base_home.setVisibility(View.VISIBLE);
//        webView.setWebViewClient(new WebViewClient(){
//            @Override
//            public boolean shouldOverrideUrlLoading(WebView view, String url) {
//                view.loadUrl(url);
//                return true;
//            }
//        });
//        webView.loadUrl("http://baidu.com");
//        String note = "";
//        String content = "<html><head><meta charset='UTF-8'><meta name='viewport' content='width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' /></head><body style='margin:0;'>" + note+ "</body></html>";
        webView.loadData(intent.getStringExtra(MonitoringGuideActivity.GUID_FLOW_CONTENT), "text/html; charset=UTF-8", null);
    }

    private void setListener() {
        base_backBtn.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.base_backBtn:
                finish();
                break;
        }
    }
}
